package com.carambatv.android.ui;

import android.app.Application;
import android.content.Context;
import android.graphics.Typeface;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class CarambaApplication extends Application {

	public Typeface typefaceHelvetica;

	@Override
	public void onCreate() {
		super.onCreate();
		typefaceHelvetica = Typeface.createFromAsset(getAssets(), "fonts/helvetica.ttf");
	}

	public Typeface getTypefaceHelvetica() {
		return typefaceHelvetica;
	}

	public boolean isInternetPresent() {
		ConnectivityManager manager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo info = manager.getActiveNetworkInfo();
		boolean isInternet;

		isInternet = (info == null || !info.isConnected() || info.isRoaming()) ? false : true;

		return isInternet;
	}

}
